home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_100 / 114_01 / guide.doc < prev    next >
Text File  |  1987-07-13  |  21KB  |  823 lines

  1. .cm screen editor:  user guide
  2. .cm source:  guide.doc
  3. .he 'guide.doc''September 8, 1981'
  4. .fo ''-#-''
  5.  
  6. .ul
  7. Basic terms
  8.  
  9.    The terms, mode, command, special character,
  10. prompt line, cursor, the current line, and the buffer
  11. are used extensively in this documentation.
  12. You will learn about the screen editor more easily if you
  13. become familiar with these terms.
  14. Let's look at each in turn.
  15.  
  16. .ti +3
  17. The screen editor is comprised of several
  18. .ul
  19. modes.
  20. You can switch between modes,
  21. but the editor can't be in two modes at the same time.
  22. The editor behaves differently in each mode,
  23. so you use each mode to do a particular type
  24. of editing.
  25.  
  26. .ti +3
  27. There are three modes:
  28. edit mode, command mode and insert mode.
  29. You use edit mode for making
  30. small changes in many different lines.
  31. Command mode is used for making larger
  32. (hence potentially more dangerous)
  33. changes to the whole file you are editing.
  34. You must be in command mode to do anything
  35. that will change files on the disk.
  36. You use insert mode for making a series of
  37. insertions into the text.
  38. First drafts are often entered in this mode.
  39.  
  40. .ti +3
  41. You use
  42. .ul
  43. commands
  44. to make things happen in each mode.
  45. Which commands you can use depends on what mode you
  46. are in.
  47. Do not confuse the terms "commands" and
  48. "command mode".
  49. Every mode has a set of commands which
  50. you can use in that mode.
  51. Command mode has its own set of commands.
  52.  
  53. .ti +3
  54. .ul
  55. Special characters
  56. are one-letter commands.
  57. Special characters must be control keys, so
  58. you can use these commands in places where the
  59. editor might not otherwise expect a command.
  60.  
  61. .ti +3
  62. The
  63. .ul
  64. prompt line
  65. is the top line of the screen.
  66. It tells you things like what line you
  67. are editing and what mode you are in.
  68. If you get confused about what mode you are in
  69. you can always glance at the prompt line
  70. and get your bearings.
  71.  
  72. .ti +3
  73. Several edit-mode commands 
  74. consist of two or more letters.
  75. These edit-mode commands are called
  76. .ul
  77. extended commands.
  78. After you type the first letter of such a command,
  79. but before you type the last letter, the
  80. prompt line will indicate that you must type one more
  81. letter to finish the extended command.
  82. For example, 
  83. after you type an "s" to enter the edit-mode search command
  84. the prompt line's mode field will contain
  85. 'edit: search'.
  86.  
  87. .ti +3
  88. The
  89. .ul
  90. cursor
  91. is a distinctive character on the screen.
  92. On most video terminals
  93. this marker is a character shown with reverse
  94. video.
  95. In command mode you always type commands on the bottom
  96. line so the cursor is always on the bottom line.
  97. In edit mode and insert mode
  98. the cursor is always on the current line.
  99.  
  100. .ti +3
  101. The
  102. .ul
  103. current line
  104. is the only line you can edit.
  105. In command mode the current line may not be shown on
  106. the screen, but in edit and insert modes
  107. the current line is shown and it contains the cursor.
  108. If you want to make a change to a line you must first
  109. move the cursor to that line.
  110.  
  111. .ti +3
  112. The
  113. .ul
  114. buffer
  115. is a part of the computer's storage which holds the file
  116. you are editing.
  117. In order to edit a disk file, you must first read the disk
  118. file into the buffer using the load command.
  119. As you edit the file the changes you make are made only
  120. to the buffer, not to your disk file.
  121. Before you end your editing session you must copy the buffer
  122. back to a disk file using the save or resave commands.
  123. The editor keeps track of whether you have done this;
  124. it won't let you forget to save your work.
  125.  
  126. .ti +3
  127. The
  128. .ul
  129. window
  130. is a part of the screen which shows a portion
  131. of the buffer.
  132. In edit and insert modes the window fills all of
  133. the screen except the prompt line.
  134. You can think of the file as a scroll of parchment which
  135. unwinds under the window as you move the cursor.
  136. The window is not shown in command mode.
  137.  
  138. .ti +3
  139. Now let's look more closely at the editor's commands.
  140. We'll start with special characters, which are commands
  141. that may be used in either insert or edit modes.
  142. Then we will look at other commands which are unique to
  143. a particular mode.
  144.  
  145. .ul
  146. Special Characters
  147.  
  148. .ti +3
  149. Special characters act the same in all modes.
  150. Special characters must be control characters so that
  151. the editor may always distinguish special characters from
  152. regular text.
  153.  
  154. .ti +3
  155. There are 14 special characters;
  156. all 14 may be used in either edit mode or insert mode.
  157. Only a few may be used in command mode.
  158.  
  159. .ti +3
  160. You can use the configuration program to choose
  161. which keys on your keyboard to use for each
  162. special character.
  163. Thus, I won't be able to
  164. be specific about what key on your keyboard you will actually
  165. hit in order to type, for instance, the down key.
  166. I'll often refer to special characters as special keys;
  167. for example, I'll call the down special character the
  168. down key.
  169.  
  170. .ti +3
  171. The
  172. .ul
  173. left and right keys
  174. just move the cursor.
  175. They do not cause changes to lines.
  176. These keys are always "anchored" to the current line;
  177. you can't move off the current line by using these keys.
  178. If you hit the right key while the cursor
  179. is at the right margin,
  180. nothing will happen.
  181. Similarly, nothing will happen if you hit the
  182. left key while the cursor is at the left margin.
  183.  
  184. .ti +3
  185. The
  186. .ul
  187. up and down keys
  188. move the cursor up and down
  189. on the screen.
  190. You can't move the cursor above line 1 of the file, nor can you
  191. move the cursor below the last line of the file.
  192. Both these keys also switch the editor to edit mode.
  193.  
  194. .ti +3
  195. The
  196. .ul
  197. insert up key
  198. inserts a blank line above the current line
  199. while the
  200. .ul
  201. insert down key
  202. inserts a blank line below the current line.
  203. Both these keys also switch the editor to insert mode.
  204.  
  205. .ti +3
  206. The
  207. .ul
  208. delete character key
  209. deletes the character to the left of the cursor.
  210. This key is anchored to the current line;
  211. nothing is deleted if the cursor is at the left margin.
  212. The
  213. .ul
  214. delete line key
  215. deletes the entire line on which the cursor rests.
  216.  
  217. .ti +3
  218. The
  219. .ul
  220. undo key
  221. always undoes whatever
  222. editing you have done on the current line since
  223. the last time the cursor came to the current line.
  224.  
  225. .ti +3
  226. The
  227. .ul
  228. insert key
  229. switches the editor to insert mode.
  230. Similarly, the
  231. .ul
  232. command key
  233. switches the editor to command mode and the
  234. .ul
  235. edit key
  236. switches the editor to edit mode.
  237.  
  238. .ti +3
  239. The
  240. .ul
  241. split key
  242. splits the current line into two pieces.
  243. Everything to the left of the cursor stays right where it is.
  244. All other characters are moved from the current line to
  245. a new line which is created below the original line.
  246.  
  247. .ti +3
  248. The
  249. .ul
  250. join key
  251. is the opposite of the split key;
  252. it combines two lines into one line.
  253. The join key appends the current line to the line above it,
  254. then deletes the lower line.
  255.  
  256. .ul
  257. Edit Mode
  258.  
  259. .ti +3
  260. Edit-mode commands are normal letters; you don't need
  261. to use special keys.
  262. This speeds typing.
  263. You can, however, use the special keys in edit mode if you
  264. want to.
  265.  
  266. .ti +3
  267. Besides the special characters you can use
  268. the following one-letter edit-mode commands:
  269. space, b, c, d, e, g, i, k, s, u, and x.
  270. These letters stand for 
  271. begin, command, down, end, go, insert, kill,
  272. search, up, and eXchange.
  273. Note that all these commands may be typed either
  274. in upper case or in lower case.
  275. Letters which are neither edit-mode commands
  276. nor special keys are simply ignored.
  277. The following paragraphs explain what these
  278. commands do in greater detail.
  279.  
  280. .ti +3
  281. The
  282. .ul
  283. space bar
  284. moves the cursor right one column.
  285. Nothing happens if the cursor is already
  286. on the rightmost column of the screen.
  287.  
  288. .ti +3
  289. The
  290. .ul
  291. b command
  292. puts the cursor at the beginning
  293. (left hand margin) of the line.
  294.  
  295. .ti +3
  296. The
  297. .ul
  298. c command
  299. switches the editor to command mode.
  300.  
  301. .ti +3
  302. The
  303. .ul
  304. d command
  305. causes the cursor to move down rapidly.
  306. The cursor keeps moving until it reaches the last line
  307. of the file or until you type any key.
  308.  
  309. .ti +3
  310. The
  311. .ul
  312. e command
  313. moves the cursor to the right end of the line.
  314.  
  315. .ti +3
  316. The
  317. .ul
  318. i command
  319. switches the editor to insert mode.
  320.  
  321. .ti +3
  322. The
  323. .ul
  324. g command
  325. moves the cursor to another line.
  326. The g command is an extended command;
  327. after you type the g the curso